home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet multimedia / Animacje, filmy i prezentacje / Odtwarzacze filmow / JahPlayer 0.1.0 / jahplayer-0.1.0-installer.exe / openlibraries-0.3.0-runtime.exe / shaders / histogram.cg < prev    next >
Text File  |  2006-08-29  |  505b  |  18 lines

  1.  
  2. // fx - A compositing library representation.
  3.  
  4. // Copyright (C) 2005-2006 Visual Media FX Ltd.
  5. // Released under the LGPL.
  6. // For more information, see http://www.openlibraries.org.
  7.  
  8. float4 main( in float2 v_tex, uniform float min, uniform float max, uniform float4 channels, uniform samplerRECT inColor0 ) : COLOR
  9. {
  10.     float4 color = texRECT( inColor0, v_tex );
  11.     
  12.     float level = clamp( dot( channels, color ), 0.0f, 1.0f );
  13.     if( level < min || level >= max )
  14.         discard;
  15.  
  16.     return color;
  17. }
  18.